From 0c8f21176bda88ad6b46e0f431dabfa6a47b3857 Mon Sep 17 00:00:00 2001 From: "kfraser@localhost.localdomain" Date: Tue, 3 Jul 2007 13:44:04 +0100 Subject: [PATCH] xen: Fix my changes to I/O-region-finding routine. Signed-off-by: Keir Fraser --- xen/arch/x86/mm.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c index b2f6a99624..c627af93bc 100644 --- a/xen/arch/x86/mm.c +++ b/xen/arch/x86/mm.c @@ -211,13 +211,12 @@ void __init arch_init_memory(void) share_xen_page_with_guest(mfn_to_page(i), dom_io, XENSHARE_writable); /* Any areas not specified as RAM by the e820 map are considered I/O. */ - pfn = i = 0; - while ( pfn < max_page ) + for ( i = 0, pfn = 0; pfn < max_page; i++ ) { while ( (i < e820.nr_map) && (e820.map[i].type != E820_RAM) ) i++; - if ( i == e820.nr_map ) + if ( i >= e820.nr_map ) { /* No more RAM regions: mark as I/O right to end of memory map. */ rstart_pfn = rend_pfn = max_page; -- 2.30.2